package com.hduong.springcloud.controller;

import com.hduong.springcloud.domain.CommonResult;
import com.hduong.springcloud.domain.Order;
import com.hduong.springcloud.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <h3>spring-cloud-demo-parent</h3>
 * <p>OrderController</p>
 *
 * @author : hduong
 * @version : 1.0
 * @date : 2020-03-23 09:11
 **/
@RestController
@RequestMapping("/order")
public class OrderController {


    @Autowired
    private OrderService orderService;

    /**
     * 创建订单
     */
    @GetMapping("/create")
    public CommonResult create(Order order) {
        orderService.create(order);
        return new CommonResult("订单创建成功!", 200);
    }
}
